<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>
        <style type="text/css">
            .col-95 {
                width: 95%;
            }

            .col-5 {
                width: 5%;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="海尔卡消费信息历史盘点">
                    <h:form>
                        <h:panelGrid columns="2" cellspacing="5" columnClasses="col-95,col-5">
                            <h:panelGrid columns="2" cellspacing="5">
                                <h:outputLabel value="截止日期:" for="endDate" style="font-weight: bold"/>
                                <p:inputText id="endDate" required="true" value="#{cardConsumeInfoHisAction.date}"
                                             onclick="WdatePicker({dateFmt:'yyyyMMdd'})" size="27"/>
                            </h:panelGrid>
                            <h:panelGrid columns="2" cellspacing="5">
                                <p:commandButton value="查询" action="#{cardConsumeInfoHisAction.onQuery}"
                                                 style=";width:80px;" update="pdtproj,msgs"/>
                                <p:commandButton style="width:100px;margin-left:15px;" value="导出EXCEL" update="msgs"
                                                 action="#{cardConsumeInfoHisAction.onExportExcel}"
                                                 ajax="false"/>
                            </h:panelGrid>
                        </h:panelGrid>
                        <p:ajaxStatus style="height:18px;text-align:center">
                            <f:facet name="start">
                                <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value=""/>
                            </f:facet>
                        </p:ajaxStatus>
                        <p:separator/>

                        <div id="qrytable">
                            <p:growl id="msgs" showDetail="false"/>
                            <p:dataTable id="pdtproj" dynamic="true" style="width:100%;"
                                         value="#{cardConsumeInfoHisAction.projCardInfoList}" var="record"
                                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                         paginator="true" rows="5" paginatorPosition="bottom"
                                         rowsPerPageTemplate="100,50,30,15,5"
                                         emptyMessage="没有查询到数据记录...">
                                <p:column headerText="项目ID" style="text-align: center">
                                    <h:outputText value="#{record.projid}"/>
                                </p:column>
                                <p:column headerText="项目名称" style="text-align: left;">
                                    <h:outputText value="#{record.projName}"/>
                                </p:column>
                                <p:column headerText="商户名称" style="text-align: left">
                                    <h:outputText value="#{record.storeName}"/>
                                </p:column>
                                <p:column headerText="卡专户账号" style="text-align: left">
                                    <h:outputText value="#{record.storeCardActno}"/>
                                </p:column>
                                <p:column headerText="专户余额">
                                    <h:outputText value="#{record.storeBalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="工贸名称" style="text-align: left">
                                    <h:outputText value="#{record.gmName}"/>
                                </p:column>
                                <p:column headerText="工贸结算账号" style="text-align: left">
                                    <h:outputText value="#{record.gmActno}"/>
                                </p:column>
                                <p:column headerText="结算户余额">
                                    <h:outputText value="#{record.gmBalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="开卡总数" style="text-align: right;">
                                    <h:outputText value="#{record.openCardCnt}"/>
                                </p:column>
                                <p:column headerText="启用卡数" style="text-align: right;">
                                    <h:outputText value="#{record.usingCardCnt}"/>
                                </p:column>
                                <p:column headerText="挂失卡数" style="text-align: right;">
                                    <h:outputText value="#{record.lossCardCnt}"/>
                                </p:column>
                                <p:column headerText="冻结卡数" style="text-align: right;">
                                    <h:outputText value="#{record.frozenCardCnt}"/>
                                </p:column>
                                <p:column headerText="注销卡数" style="text-align: right;">
                                    <h:outputText value="#{record.cancelCardCnt}"/>
                                </p:column>
                                <p:column headerText="开卡总金额">
                                    <h:outputText value="#{record.allCardTotalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="启用总金额">
                                    <h:outputText value="#{record.openCardTotalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="消费总额">
                                    <h:outputText value="#{record.cardConsumeTotalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="可消费余额">
                                    <h:outputText value="#{record.cardTotalBalAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="已清算额">
                                    <h:outputText value="#{record.squaredAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="未清算余额">
                                    <h:outputText value="#{record.noSquareAmt}" style="float: right">
                                        <f:convertNumber pattern="###,##0.00"/>
                                    </h:outputText>
                                </p:column>
                            </p:dataTable>
                            <p:separator/>
                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>